<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>我的世界 - 注册</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Minecraft', 'Arial', sans-serif;
        }

        @font-face {
            font-family: 'Minecraft';
            src: url('https://fonts.cdnfonts.com/css/minecraft-4');
            font-display: swap;
        }

        body {
            background: #8cc8ff;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            position: relative;
            overflow: hidden;
        }

        /* 天空背景与动画 */
       .sky {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: linear-gradient(to bottom, #8cc8ff 0%, #a4d3ff 100%);
            z-index: -1;
        }

       .sun {
            position: absolute;
            top: 10%;
            right: 15%;
            width: 80px;
            height: 80px;
            background: #ffd700;
            border-radius: 50%;
            box-shadow: 0 0 40px #ffd700;
            animation: rotateSun 60s linear infinite;
        }

        @keyframes rotateSun {
            from {
                transform: rotate(0deg) translateX(20px) rotate(0deg);
            }
            to {
                transform: rotate(360deg) translateX(20px) rotate(-360deg);
            }
        }

        /* 地面与纹理 */
       .ground {
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 30%;
            background: #6c9e41;
            z-index: -1;
        }

       .ground::before {
            content: '';
            position: absolute;
            top: -10px;
            left: 0;
            width: 100%;
            height: 10px;
            background: #8cc665;
        }

       .ground::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-image: 
                linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
                linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
            background-size: 40px 40px;
        }

        /* 像素化云朵 */
       .cloud {
            position: absolute;
            background: white;
            border-radius: 50%;
            z-index: 1;
            animation: floatCloud 15s infinite linear;
        }

       .cloud-1 {
            width: 100px;
            height: 40px;
            top: 10%;
            left: 5%;
            box-shadow: 50px -10px 0 -10px white,
                        100px 10px 0 -10px white,
                        150px -5px 0 -10px white;
            animation-delay: 0s;
        }

       .cloud-2 {
            width: 80px;
            height: 30px;
            top: 15%;
            left: 30%;
            box-shadow: 40px 0px 0 -10px white,
                        80px -5px 0 -10px white,
                        120px 5px 0 -10px white;
            animation-delay: 2s;
        }

       .cloud-3 {
            width: 120px;
            height: 50px;
            top: 8%;
            left: 60%;
            box-shadow: 60px -15px 0 -10px white,
                        120px 5px 0 -10px white,
                        180px -10px 0 -10px white;
            animation-delay: 4s;
        }

        @keyframes floatCloud {
            0% {
                transform: translateX(-100px);
            }
            100% {
                transform: translateX(calc(100vw + 100px));
            }
        }

        /* 注册面板 */
       .register-panel {
            background: #c6c6c6;
            border: 8px solid #333;
            padding: 30px;
            min-width: 350px;
            box-shadow: 8px 8px 0 rgba(0, 0, 0, 0.3);
            position: relative;
            z-index: 2;
        }

        /* 标题 */
       .register-title {
            font-size: 2rem;
            color: #333;
            text-align: center;
            margin-bottom: 25px;
            text-shadow: 3px 3px 0 #999;
            letter-spacing: 2px;
        }

        /* 表单样式 */
       .register-form {
            display: flex;
            flex-direction: column;
            gap: 15px;
        }

       .form-group {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

       .form-label {
            font-size: 1rem;
            color: #333;
            text-shadow: 1px 1px 0 #999;
        }

       .form-input {
            padding: 10px;
            background: #fff;
            border: 4px solid #333;
            font-size: 1rem;
            color: #333;
            box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.2);
            transition: all 0.2s;
        }

       .form-input:focus {
            outline: none;
            border-color: #557a35;
        }

        /* 确认密码样式 */
       .confirm-password-group {
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

       .confirm-password-label {
            font-size: 1rem;
            color: #333;
            text-shadow: 1px 1px 0 #999;
        }

       .confirm-password-input {
            padding: 10px;
            background: #fff;
            border: 4px solid #333;
            font-size: 1rem;
            color: #333;
            box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.2);
            transition: all 0.2s;
        }

       .confirm-password-input:focus {
            outline: none;
            border-color: #557a35;
        }

        /* 注册按钮样式 */
       .btn {
            padding: 12px;
            background: #6c9e41;
            color: white;
            border: 4px solid #557a35;
            font-size: 1.1rem;
            font-weight: bold;
            text-shadow: 2px 2px 0 #446624;
            box-shadow: 4px 4px 0 #333;
            cursor: pointer;
            transition: all 0.2s;
        }

       .btn:hover {
            transform: translate(2px, 2px);
            box-shadow: 2px 2px 0 #333;
            background: #7cae51;
        }

       .btn:active {
            transform: translate(4px, 4px);
            box-shadow: 0 0 0 #333;
        }

        /* 已经有账号链接 */
       .already-have-account {
            text-align: center;
            margin-top: 20px;
            color: #333;
        }

       .already-have-account a {
            color: #0000aa;
            text-decoration: none;
            text-shadow: 1px 1px 0 #999;
        }

       .already-have-account a:hover {
            color: #0000ff;
        }

        /* 装饰性方块 */
       .decor-block {
            position: absolute;
            width: 40px;
            height: 40px;
            z-index: 1;
        }

       .grass {
            background: #6c9e41;
            border: 2px solid #557a35;
        }

       .wood {
            background: #8b4513;
            border: 2px solid #6d3510;
        }

       .stone {
            background: #a0a0a0;
            border: 2px solid #808080;
        }

       .coal {
            background: #333;
            border: 2px solid #1a1a1a;
        }

        /* 方块位置 */
       .pos-1 {
            top: 20%;
            left: 15%;
            animation: float 12s infinite ease-in-out;
        }

       .pos-2 {
            top: 60%;
            left: 80%;
            animation: float 14s infinite ease-in-out 1s;
        }

       .pos-3 {
            top: 40%;
            left: 90%;
            animation: float 16s infinite ease-in-out 2s;
        }

       .pos-4 {
            top: 70%;
            left: 10%;
            animation: float 13s infinite ease-in-out 3s;
        }

       .pos-5 {
            top: 30%;
            left: 5%;
            animation: float 15s infinite ease-in-out 4s;
        }

        @keyframes float {
            0%,
            100% {
                transform: translateY(0) rotate(0deg);
            }
            50% {
                transform: translateY(-20px) rotate(5deg);
            }
        }

        /* 响应式设计 */
        @media (max-width: 500px) {
           .register-panel {
                min-width: auto;
                width: 90%;
                padding: 20px;
                border-width: 6px;
            }

           .register-title {
                font-size: 1.5rem;
            }
        }
    </style>
</head>

<body>
    <div class="sky"></div>
    <div class="ground"></div>

    <!-- 云朵 -->
    <div class="cloud cloud-1"></div>
    <div class="cloud cloud-2"></div>
    <div class="cloud cloud-3"></div>

    <!-- 装饰方块 -->
    <div class="decor-block grass pos-1"></div>
    <div class="decor-block wood pos-2"></div>
    <div class="decor-block stone pos-3"></div>
    <div class="decor-block coal pos-4"></div>
    <div class="decor-block grass pos-5"></div>

    <!-- 注册面板 -->
    <div class="register-panel">
        <h1 class="register-title">我的世界注册</h1>
        <form class="register-form" id="registerForm">
            <div class="form-group">
                <label class="form-label" for="username">用户名</label>
                <input type="text" id="username" class="form-input" placeholder="输入你的用户名" required>
            </div>
            <div class="form-group">
                <label class="form-label" for="email">邮箱</label>
                <input type="email" id="email" class="form-input" placeholder="输入你的邮箱" required>
            </div>
            <div class="form-group">
                <label class="form-label" for="password">密码</label>
                <input type="password" id="password" class="form-input" placeholder="输入你的密码" required>
            </div>
            <div class="confirm-password-group">
                <label class="confirm-password-label" for="confirmPassword">确认密码</label>
                <input type="password" id="confirmPassword" class="confirm-password-input" placeholder="再次输入你的密码" required>
            </div>
            <button type="submit" class="btn">注册账号</button>
            <p class="already-have-account">
                已经有账号? <a href="#">登录</a>
            </p>
        </form>
    </div>
    <script>
        document.getElementById('registerForm').addEventListener('submit', function (e) {
            e.preventDefault();
            const username = document.getElementById('username').value;
            const email = document.getElementById('email').value;
            const password = document.getElementById('password').value;
            const confirmPassword = document.getElementById('confirmPassword').value;

            if (password!== confirmPassword) {
                alert('两次输入的密码不一致，请重新输入！');
                return;
            }

            // 这里可以添加实际注册逻辑，比如通过ajax将数据发送到后端
            console.log({
                username: username,
                email: email,
                password: password
            });
            alert('注册成功！');
        });
    </script>
</body>

</html>